import { Select } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import { useOptions } from "@/hooks"
import { useLocale } from "@/locales"

const TableTypeSelect: FC<{ isHideLabel?: boolean; width?: number }> = ({ isHideLabel = false, width = 200 }) => {
	const { newFormat, formatMessage } = useLocale()
	const options = useOptions({ modal: "gameType", func: formatMessage })

	return (
		<SFormItem name="tableType" label={isHideLabel ? "" : newFormat("dxn.card_ables_list.game_name")}>
			<Select allowClear placeholder={newFormat("common.select_all")} options={options} style={{ width: width }} />
		</SFormItem>
	)
}

export default TableTypeSelect
